import Vue from "vue";
import VueRouter from "vue-router";
import routerView from "@/layout/index.vue";
import { routerList, subRouter } from "./routerModule";

Vue.use(VueRouter);

const routes = [
  {
    name: "login",
    path: "/login",
    component: () => import("../views/login"),
  },
  {
    name: "/",
    path: "/",
    redirect: "/home",
    component: routerView,
    children: [...routerList,...subRouter],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
